/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rpt.lib;

/**
 *
 * @author Roberto
 */
public class CFormatador {

    static public String mascara(
        boolean aUsarSeparadorMilhar,
        int aNumCasasDecimais,
        String aCaracterMascara) {
        //
        String m = null;
        if (aUsarSeparadorMilhar)
            m = "#,##0";
        else
            m = "0";
        if (aNumCasasDecimais > 0) {
            m = m + ".";
            for (int i = 0; i < aNumCasasDecimais; i++) {
                m = m + aCaracterMascara;
            }
        }
        return m;
    }

}
